import Oidc from 'oidc-client';

let setting = {
    title:'服务到家后台系统',
    openidConfig:{
        client_id:'systemweb',
        authority:process.env.AUTHORITY_API_ROOT,
        //过期前多少时间(60s)提醒,相对服务端设置的AccessTokenLifetime
        accessTokenExpiringNotificationTime:60,   
        //登录成功，重定向
        redirect_uri:`${window.location.origin}/oidc-callback`,
        response_type: "id_token token",//id_token token  code
        scope: "openid profile orderingapi catalogapi locationapi paymentapi",
        //登出跳转
        post_logout_redirect_uri: `${window.location.origin}/login`,
        //启用静默刷新token
        silent_redirect_uri:`${window.location.origin}/oidc-silent-renew`,
        automaticSilentRenew: true,
        // this will allow all the OIDC protocol claims to be visible in the window. normally a client app 
        // wouldn't care about them or want them taking up space
        filterProtocolClaims: false,
        loadUserInfo: true,
        userStore: new Oidc.WebStorageStateStore({ store: window.localStorage })
    },

}
export default setting;